home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / vtban.zip / VT.SCT
Text File  |  1991-05-15  |  6KB  |  289 lines

  1. {                  VT.SCT
  2.  
  3.     This script is designed to work specificly with the Ven-Tel 9600 Plus
  4.     line of modems. If neither the 9600 PLUS or 9600 PLUS II are detected,
  5.     a Hayes Smartmodem 1200 will be presumed.
  6.  
  7.     All waitfor statements contain checks for the ESC key for user exit.
  8. }
  9.  
  10.  
  11. set ESCKEYSTR "\033\033";         { Define ESC string }
  12.  
  13. {   Reset the modem. }
  14.  
  15. startup:
  16.     prompt "Resetting the modem.                        \015\012";
  17.     set dtr 1;
  18.     pause 1;
  19.     set dtr 1;
  20.     set rts 1;
  21.     send "ATZ\015";
  22.     pause 5;
  23.  
  24. {   Try to determine which baud rate to start communicating at.
  25.     Initially use the baud rate specified in SETDIAL. If we don't
  26.     get an "OK" back from the "ATV1" command, adjust to 1200.
  27. }
  28.  
  29.  
  30. set rbuf "";
  31. send "ATV1\015";
  32.  
  33. waitfor max 2 seconds
  34.  
  35.     keystr=ESCKEYSTR:
  36.      goto userescape;
  37.  
  38.     response="OK":
  39.      break;
  40.  
  41.     timeout:
  42.      set speed 1200;
  43.      break;
  44.  
  45. endwaitfor;
  46.  
  47. {    Now do a soft reset and set the modem to not echo commands }
  48. {    and return verbose result codes.                }
  49.  
  50. send "ATE0Q0V1\015";
  51. waitfor max 5 seconds response="OK";
  52.     break;
  53. endwaitfor;
  54.  
  55.  
  56. {   Issue an interrogate command to the modem so we can try    }
  57. {   and detect which type of modem it is.  Any modem which does }
  58. {   not respond, or which sends back a result code we do  not    }
  59. {   recognize, will be assumed to be Hayes 1200 compatible. The }
  60. {   only modems we will check for is the Ven-Tel 9600 PLUS and    }
  61. {   9600 PLUS II.                        }
  62.  
  63. set rbuf "";            { Clear response buffer... }
  64. send "ATI\015";         { Interrogate command }
  65.  
  66. waitfor max 5 seconds
  67.  
  68.     keystr=ESCKEYSTR: goto userescape;
  69.  
  70.     response="EC9600 Plus":
  71.      prompt "\015\012";
  72.      prompt "Ven-Tel 9600 PLUS detected.";
  73.      prompt "\015\012";
  74.      pause 1;
  75.      send "AT&C1%C1\015";
  76.  
  77. {     &C1 = DTE carrier is true carrier             }
  78. {     %C1 = Enables data compression              }
  79.  
  80.      set speed 19200;
  81.      pause 1;
  82.      break;
  83.  
  84.     response="EC9600 Plus II":
  85.      prompt "\015\012";
  86.      prompt "Ven-Tel 9600 PLUS II detected.";
  87.      prompt "\015\012";
  88.      pause 1;
  89.      send "AT&C1%C1\015";
  90.  
  91. {     &C1 = DTE carrier is true carrier             }
  92. {     %C1 = Enables data compression              }
  93.  
  94.      set speed 19200;
  95.      pause 1;
  96.      break;
  97.  
  98.     timeout:
  99.      prompt "\015\012";
  100.      prompt "Modem type not determined, assumed to be Hayes 1200 compatible.";
  101.      prompt "\015\012";
  102.      break;
  103.  
  104. endwaitfor;
  105.  
  106.  
  107. {   Dial the phone using the number in SETDIAL.      }
  108. {   Wait for a modem result code.  If a connect code is  }
  109. {   received, set the baud rate to the proper value.  If }
  110. {   the line is busy tell the user to try again later.     }
  111. {   If a connection cannot be established, suggest     }
  112. {   appropriate action.                  }
  113.  
  114.  
  115.     send "ATS7=210\015";
  116.     pause 1;
  117.     set rbuf "";             { Clear response buffer }
  118.  
  119.  
  120. {   Turn speaker on/off according to call_monitor variable. }
  121.  
  122. if call_monitor: goto speakeron;
  123.  
  124. speakeroff:
  125.     send "ATM0\015";
  126.     prompt "Call monitoring off...\015\012";
  127.     goto sdone;
  128.  
  129. speakeron:
  130.     send "ATM1\015";
  131.     prompt "Call monitoring on...\015\012";
  132.  
  133. sdone:
  134.     pause 2;
  135.  
  136. {   Send command to not wait for dial tone if blind dial set }
  137.  
  138. if blind_dial: goto blindial;
  139.     send "ATX4V0\015";              { Enable extended numeric result codes }
  140.     goto dialit;
  141.  
  142. blindial:
  143.     send "ATX1V0\015";              { Just basic numeric result codes }
  144.  
  145. dialit:
  146.     pause 1;
  147.  
  148.     set rbuf "";                  { Clear response buffer.}
  149.     send "ATDT,";                 { Dial the number speicifed }
  150.     send number;          {  in SETDIAL }
  151.     send "\015";
  152.     pause 1;
  153.  
  154. wait_for_connect:
  155.  
  156. waitfor max call_timeout seconds
  157.  
  158.     keystr=ESCKEYSTR: goto userescape;
  159.  
  160.     response="5":
  161.      prompt "\015\012Connection established at 1200.\015\012";
  162.      break;
  163.  
  164.     response="9":
  165.      prompt "\015\012Connection established at V.22.\015\012";
  166.      goto setspd2N;
  167.  
  168.     response="10":
  169.      prompt "\015\012Connection established at 2400.\015\012";
  170.      goto setspd2N;
  171.  
  172.     response="11":
  173.      prompt "\015\012Connection established at 4800.\015\012";
  174.      goto setspd1N;
  175.  
  176.     response="12":
  177.      prompt "\015\012Connection established at 9600.\015\012";
  178.      goto setspd1N;
  179.  
  180.     response="13":
  181.      prompt "\015\012Connection established at V.21.\015\012";
  182.      goto setspd3N;
  183.  
  184.     response="22":
  185.      prompt "\015\012Connection established at 1200/REL.\015\012";
  186.      goto setspd2;
  187.  
  188.     response="23":
  189.      prompt "\015\012Connection established at 2400/REL.\015\012";
  190.      goto setspd1;
  191.  
  192.     response="24":
  193.      prompt "\015\012Connection established at V.22/REL.\015\012";
  194.      goto setspd1;
  195.  
  196.     response="25":
  197.      prompt "\015\012Connection established at 4800/REL.\015\012";
  198.      goto setspd1;
  199.  
  200.     response="27":
  201.      prompt "\015\012Connection established at 9600/REL.\015\012";
  202.      goto setspd;
  203.  
  204.     response="28":
  205.      prompt "\015\012Connection established at 9600 TRELLIS.\015\012";
  206.      goto setspd1;
  207.  
  208.     response="29":
  209.      prompt "\015\012Connection established at 9600 TRELLIS/REL.\015\012";
  210.      goto setspd;
  211.  
  212.     response="61":
  213.      prompt "\015\012Connection established at 12000 TRELLIS.\015\012";
  214.      goto setspdN;
  215.  
  216.     response="63":
  217.      prompt "\015\012Connection established at 12000 TRELLIS/REL.\015\012";
  218.      goto setspd;
  219.  
  220.     response="7":
  221.      prompt "\015\012The line is busy.\015\012Please try later.\015\012";
  222.      send "ATZ\015";
  223.      exit -1;               { Terminate script }
  224.      break;
  225.  
  226.      timeout:
  227.      prompt "\015\012Connection could not be established.";
  228.      prompt "\015\012Check cabling and phone line.";
  229.      set dtr 0;                 {clean up on the way out}
  230.      pause 2;
  231.      send "ATZ\015";
  232.      exit -1; {Terminates script }
  233.      break;
  234.  
  235.      disconnect:
  236.      send "ATHZ\015",
  237.  
  238. setspd:
  239.     set erecovery 1;
  240.     set speed 19200;
  241.     pause 2;
  242.     passport;
  243.     break;
  244.  
  245. setspdN:
  246.     set erecovery 0;
  247.     set speed 19200;
  248.     pause 2;
  249.     passport;
  250.     break;
  251.  
  252. setspd1:
  253.     set erecovery 1;
  254.     set mtype 4;
  255.     set speed 19200;
  256.     pause 2;
  257.     passport;
  258.     break;
  259.  
  260. setspd1N:
  261.     set erecovery 0;
  262.     set speed 9600;
  263.     pause 2;
  264.     passport;
  265.     break;
  266.  
  267. setspd2:
  268.     set erecovery 1;
  269.     set speed 2400;
  270.     pause 2;
  271.     passport;
  272.     break;
  273.  
  274. setspd2N:
  275.     set erecovery 0;
  276.     set speed 2400;
  277.     pause 2;
  278.     passport;
  279.     break;
  280.  
  281. setspd3N:
  282.     set erecovery 0;
  283.     set speed 1200;
  284.     pause 2;
  285.     passport;
  286.     break;
  287.  
  288. endwaitfor;
  289.